package org.dynobjects.core;

import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;

public class ResourceContainer extends HashMap {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public InputStream getResource(Object key){
		return (InputStream) super.get(key);
	}
	
	public ResourceContainer addResource(Object key,InputStream resource){
		super.put(key, resource);
		return this;
	}
	
	public InputStream[] getResources(){
		Collection resourceCollection = super.values();
		InputStream[] resources = new InputStream[resourceCollection.size()];
		resourceCollection.toArray(resources);
		return resources;
	}

}
